package com.yycx.module.bus.provider.handler;

import com.yycx.common.base.entity.EntityMap;
import com.yycx.common.mybatis.interceptor.PageInterceptor;
import com.yycx.common.mybatis.model.PageParams;
import com.yycx.common.mybatis.model.ResultBody;
import com.yycx.common.mybatis.query.CriteriaQuery;
import com.yycx.module.bus.client.entity.BusCustomRate;
import com.yycx.module.bus.client.entity.BusDept;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 部门价格配置列表
 *
 * @author zyf
 */
@Component("deptRateDrugsListHandler")
public class DeptRateDrugsListHandler implements PageInterceptor<BusCustomRate> {


    @Override
    public ResultBody validate(CriteriaQuery cq, EntityMap params) {
        return ResultBody.ok();
    }

    @Override
    public void prepare(CriteriaQuery cq, PageParams pageParams, EntityMap params) {
        cq.addSelect(BusDept.class, "deptName");
        cq.isNotNull("bcr.deptId");
        cq.createJoin(BusDept.class);
    }


}
